﻿
CREATE PROCEDURE [dbo].[OPM_ReturnOrderDetail_Insert]
(
	@ReturnOrderId  int,
	@ProductNumber  nvarchar(50),
	@ProductQty  int,
	@ReturnTypeId  int,
	@ReturnReasonXML  xml,
	@OtherReasonChecked bit,
	@OtherReasonContent nvarchar(4000),
	@CreatedBy int,
	@Id int OUTPUT
)

AS


INSERT INTO dbo.[OPM_ReturnOrderDetail]
(
	[ReturnOrderId],
	[ProductNumber],
	[ProductQty],
	[ReturnTypeId],
	[ReturnReasonXML],
	[OtherReasonChecked],
	[OtherReasonContent],
	[Deleted],
	[CreatedBy],
	[UpdatedBy],
	[CreatedOn],
	[UpdatedOn],
    [ROWGUID]
)
VALUES
(
	@ReturnOrderId,
	@ProductNumber,
	@ProductQty,
	@ReturnTypeId,
	@ReturnReasonXML,
	@OtherReasonChecked,
	@OtherReasonContent,
	0,
	@CreatedBy,
	@CreatedBy,
	getdate(),
	getdate(),
    newid()
)

SET @Id = SCOPE_IDENTITY();

--#endregion